﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace CartoLab.GeometryLib.AlgorithmExtent
{
    public class ColorAlgorithm
    {
        #region  cmyk转换为rgb
        /// <summary>
        /// cmyk转换为rgb
        /// </summary>
        /// <param name="c"></param>
        /// <param name="m"></param>
        /// <param name="y"></param>
        /// <param name="k"></param>
        /// <returns></returns>
        public static Color CMYKtoRGB(int c, int m, int y, int k)
        {
            int r, g, b;
            r = 255 * (100 - c) * (100 - k) / 10000;
            g = 255 * (100 - m) * (100 - k) / 10000;
            b = 255 * (100 - y) * (100 - k) / 10000;
            return Color.FromArgb(255, r, g, b);
        }
        #endregion
    }
}
